package com.frxuexi.park2209.park

import android.content.Intent
import android.graphics.BitmapFactory
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.frxuexi.park2209.R
import com.frxuexi.park2209.databinding.ActivityParkVractivityBinding
import com.google.vr.sdk.widgets.pano.VrPanoramaView

class ParkVRActivity : AppCompatActivity() {
    lateinit var binding:ActivityParkVractivityBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding=ActivityParkVractivityBinding.inflate(layoutInflater)
        setContentView(binding.root)

        binding.headParkvr.headerTitle.text="车位预览"
        binding.headParkvr.ivBack.setOnClickListener {
            finish()
        }
        binding.headParkvr.headerAdd.apply {
            visibility=View.VISIBLE
            setOnClickListener {
                startActivity(Intent(this@ParkVRActivity,ParkAddActivity::class.java))
                finish()
            }
        }
        val options = VrPanoramaView.Options()
        options.inputType=VrPanoramaView.Options.TYPE_MONO//设置水平360度旋转
        binding.parkVr.loadImageFromBitmap(BitmapFactory.decodeResource(resources,R.drawable.vrimg),options)
    }
}